/**  
 * All rights Reserved, Designed By https://www.cnblogs.com/jiduoduo
 * @Title:  RemoteAccountResource.java
 * @Package com.jiduoduo.controller
 * @Description:    来自网络
 * @author: jiduoduo
 * @date:   2022年8月11日
 * @version v1.0
 */
package com.jiduoduo.controller;

import java.util.ArrayList;
import java.util.List;

import org.flowable.ui.common.model.UserRepresentation;
import org.flowable.ui.common.security.DefaultPrivileges;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping({ "/app", "/" })
public class RemoteAccountResource{

	/**
	 * GET /rest/account -> get the current user.
	 */
	@RequestMapping(value = "/rest/account", method = RequestMethod.GET, produces = "application/json")
	public UserRepresentation getAccount() {
		UserRepresentation userRepresentation = new UserRepresentation();
		userRepresentation.setFirstName("admin");
		userRepresentation.setLastName("admin");
		userRepresentation.setFullName("admin");
		userRepresentation.setId("admin");
		List<String> pris = new ArrayList<>();
		pris.add(DefaultPrivileges.ACCESS_MODELER);
		pris.add(DefaultPrivileges.ACCESS_IDM);
		pris.add(DefaultPrivileges.ACCESS_ADMIN);
		pris.add(DefaultPrivileges.ACCESS_TASK);
		pris.add(DefaultPrivileges.ACCESS_REST_API);
		userRepresentation.setPrivileges(pris);

		return userRepresentation;
	}
}
